<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>注册</title>
		<link rel="stylesheet" href="css/pintuer.css">
		<link rel="stylesheet" href="css/admin.css">
		<link rel="stylesheet" href="css/dayong.css">
		<script src="js/jquery.js"></script>
		<script src="js/pintuer.js"></script>
		<script src="js/admin.js"></script>
		<link type="image/x-icon" href="http://www.pintuer.com/favicon.ico" rel="shortcut icon" />
		<link href="http://www.pintuer.com/favicon.ico" rel="bookmark icon" />
		<style type="text/css">
			.field-icon-right .icon{
				top:10px;
			}
		</style>
	</head>
	<body>
		<div class="container content">
			<div class="line">
				<div class="xs6 xm4 xs3-move xm4-move">
					<br />
					<br />
					<div class="media media-y">
						<a href="indexFront.jsp" ><img src="images/logo.png" class="radius" alt="后台管理系统" /></a>
					</div>
					<br />
					<br />
					<form action="registerServlet" method="post">
						<div class="panel">
							<div class="panel-body" style="padding:30px;">
								<div class="form-group">
									<div class="field field-icon-right">
										<input type="text" id="username" class="input" name="username" placeholder="登录账号" />
										<span class="icon icon-user"></span>
									</div>
								</div>
								<div class="form-group">
									<div class="field field-icon-right">
										<input type="password" class="input" name="password" placeholder="登录密码"  />
										<span class="icon icon-key"></span>
									</div>
								</div>
								<div class="form-group">
									<select style="width:331px;height:34px" name="userType" id="userType">
									</select>
								</div>
							</div>
							<div class="panel-foot text-center">
								<button class="button button-block bg-main text-big" type="submit">注册</button>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		document.getElementById("username").focus();
		function userTypeLoad(){
				var url = getUrl()+'/userTypeLoadServlet';
				//alert(url);
				console.log(url);
					 $.ajax({
					   type: "post",
					   url: url,
					   dataType: 'json',
					   /* contentType: "application/x-www-form-urlencoded; charset=utf-8", */
						data: {
						},
					   beforeSend: function (xhr) {
					   },
					   success: function (json) {
						   var length = json.length;
						   //console.log(json); 
						   for(var i = 0 ;i<length ;i++){	
						   		//alert(json[i].userType)
						   		$('#userType').append("<option value=\""+json[i].userType+"\">"+json[i].userDescription+"</option>");
						   	}
					   },
					   error: function (jqXHR, textStatus, errorThrown) {
					  		 alert("错误提示!!!!");
					   }
					}); 
			}
		userTypeLoad();
	</script>
</html>